svm: Rationalise register synchronisation to be similar to our vmx
authorKeir Fraser <keir@xensource.com>
Thu, 10 May 2007 22:49:04 +0000 (23:49 +0100)
committerKeir Fraser <keir@xensource.com>
Thu, 10 May 2007 22:49:04 +0000 (23:49 +0100)
commitdb82fef5d63e74c174b496db1551b975f36200ef
tree63b3ec37c9b88082c3fd7a186bcfd007ecfa82c8
parent72a9bb3cfb4031290eafc99f0c220d9dd8eb9eb3
svm: Rationalise register synchronisation to be similar to our vmx
handling.
 1. Do not copy all VMCB register state in cpu_user_regs on every
 vmexit.
 2. Save/restore RAX inside asm stub (in particular, before STGI on
 vmexit).
 3. Simplify store/load_cpu_guest_regs() hook functions to synchronise
 precisely the same state as VMX.

By my measurements this reduces the round-trip latency for a null
hypercall by around 150 cycles. This is about 3% of the ~5000-cycle
total on my AMD X2 system. Not a great win, but a nice extra on top of
the code rationalisation.
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/x86_32/exits.S
xen/arch/x86/hvm/svm/x86_64/exits.S